Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding session manager #943

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

scicco
Copy link

@scicco scicco commented Oct 15, 2024

Description

This commit attempts to clean old strays after some time. Currently, the expiration check is accomplished every time a new connection is made.

Related to issue #846

How to test this

  1. Create two or three users named test<n> where n means the amount of minutes before expiration if no new connection is performed
  2. Open your favourite browser and use some extension that separates sessions from one tab to another
  3. Login with test<n> on a tab
  4. use it a little bit then wait n minutes
  5. Login with admin on another tab
  6. Go back to test<n> tab: the previous "session " of test<n> should be cleaned (the chat history should be empty)

What is missing

Currently, the cleanup and the refresh of sessions happen only when a new connection is done. We need also to refresh the expiration when a user's message arrives. I need some guidance to understand where is the right place to invoke refresh on the code, I think the call should go in some line of

async def __call__(self, message_dict):

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@zAlweNy26
Copy link
Member

Wrong target branch, please point to develop

@scicco
Copy link
Author

scicco commented Oct 15, 2024

Wrong target branch, please point to develop

oh you're right, sorry, I'll fix it

@scicco scicco changed the base branch from main to develop October 15, 2024 19:29
@pieroit
Copy link
Member

pieroit commented Oct 15, 2024

Awesome.
Will review in a few days, thanks

@scicco scicco force-pushed the feature/session_manager branch 17 times, most recently from 074fb78 to dd49557 Compare October 15, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants